package com.ruoyi.project.system.relevantimg.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.system.relevantimg.domain.RelevantImg;
import com.ruoyi.project.system.relevantimg.mapper.RelevantImgMapper;
import com.ruoyi.project.system.relevantimg.service.IRelevantImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 相关图片Service业务层处理
 * 
 * @author LCL
 * @date 2020-12-10
 */
@Service
public class RelevantImgServiceImpl implements IRelevantImgService 
{
    @Autowired
    private RelevantImgMapper relevantImgMapper;

    /**
     * 查询相关图片
     * 
     * @param id 相关图片ID
     * @return 相关图片
     */
    @Override
    public RelevantImg selectRelevantImgById(String id)
    {
        return relevantImgMapper.selectRelevantImgById(id);
    }

    /**
     * 查询相关图片列表
     * 
     * @param relevantImg 相关图片
     * @return 相关图片
     */
    @Override
    public List<RelevantImg> selectRelevantImgList(RelevantImg relevantImg)
    {
        return relevantImgMapper.selectRelevantImgList(relevantImg);
    }

    /**
     * 新增相关图片
     * 
     * @param relevantImg 相关图片
     * @return 结果
     */
    @Override
    public int insertRelevantImg(RelevantImg relevantImg)
    {
        return relevantImgMapper.insertRelevantImg(relevantImg);
    }

    /**
     * 修改相关图片
     * 
     * @param relevantImg 相关图片
     * @return 结果
     */
    @Override
    public int updateRelevantImg(RelevantImg relevantImg)
    {
        return relevantImgMapper.updateRelevantImg(relevantImg);
    }

    /**
     * 删除相关图片对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRelevantImgByIds(String ids)
    {
        return relevantImgMapper.deleteRelevantImgByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除相关图片信息
     * 
     * @param id 相关图片ID
     * @return 结果
     */
    @Override
    public int deleteRelevantImgById(String id)
    {
        return relevantImgMapper.deleteRelevantImgById(id);
    }

    @Override
    public List<RelevantImg> findListByRelIdAndType(String relId, Integer type) {
        return relevantImgMapper.findListByRelIdAndType(relId,type);
    }

    @Override
    public int deleteByRelId(String relId) {
        return relevantImgMapper.deleteByRelId(relId);
    }
}
